{% extends 'base.html' %}
{% block title %} 登录页 {% endblock %}
{% block article %}
    <div class="col-sm-offset-4 col-sm-4" style="margin-top: 50px;">
        <form class="form-horizontal" role="form" action="{% url 'login' %}" method="post">
            {% csrf_token %}
            <!-- 如果账号或密码错误，输出提示 -->
            {% if message %}
                <h3 class="text-danger">{{ message }}</h3>
            {% endif %}
            <div class="form-group">
                <label for="username" class="col-sm-2 control-label">用户名</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="username" placeholder="请输入用户名" name="username">
                </div>
            </div>
            <div class="form-group">
                <label for="password" class="col-sm-2 control-label">密码</label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" id="password" placeholder="请输入密码" name="password">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-default">登录</button>
                </div>
            </div>
        </form>
    </div>
{% endblock %}